package com.yoomiito.app.adapter.withdraw;

import android.app.Activity;
import android.content.Intent;
import android.view.View;
import android.widget.ImageView;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.yoomiito.app.R;
import com.yoomiito.app.model.home.FreeGoodsInfo;
import com.yoomiito.app.model.my.ApplyInfo;
import com.yoomiito.app.ui.my.remain.withdraw.AddWithdrawActivity;
import com.yoomiito.app.ui.my.remain.withdraw.WithdrawActivity;
import com.yoomiito.app.utils.ImageLoader;
import com.yoomiito.app.widget.SelectView;

import java.util.List;

public class WithdrawListAdapter extends BaseQuickAdapter<ApplyInfo, BaseViewHolder> {
    private Activity activity;
    public WithdrawListAdapter(Activity activity) {
        super(R.layout.item_withdraw_list);
        this.activity = activity;
    }

    @Override
    protected void convert(BaseViewHolder helper, ApplyInfo item) {
        ImageView iv = helper.getView(R.id.iv_photo);
        ImageLoader.getInstance().into(iv.getContext(), item.codeUrl, iv);
        helper.setText(R.id.tv_way,item.typeStr);
        helper.setText(R.id.tv_remark,item.remark);
        helper.setText(R.id.tv_name,item.userName);
        helper.setText(R.id.tv_account,item.accountNumber);
        helper.setText(R.id.tv_way_name,item.typeStr+"账号");
        helper.setText(R.id.tv_code,item.typeStr+"收款码");
        helper.setOnClickListener(R.id.item_edit, new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(mContext, AddWithdrawActivity.class);
                intent.putExtra("applyInfo",item);
                activity.startActivity(intent);
            }
        });

    }
}
